import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [{
    path: "/login",
    component: () => import("@/views/login/index.vue")
  },
  {
    path: "/",
    component: () => import("@/views/home/index.vue"),
    children: [{
        path: "/",
        component: () => import("@/views/shouye/index.vue")
      },
      {
        path: "/wenda",
        component: () => import("@/views/wend/index.vue")
      },
      {
        path: "/shipin",
        component: () => import("@/views/shipin/index.vue")
      },
      {
        path: "/weidenglu",
        component: () => import("@/views/weidenglu/index.vue")
      },

    ]
  },
  {
    path: "/search",
    component: () => import("@/views/search/search.vue")
  },
  {
    path: "/article/:artId",
    component: () => import("@/views/article/index.vue"),
    props: true
  },
  {
    path: "/user/profile",
    name: 'profile',
    component: () => import("@/views/user-profile/index.vue"),

  },
];

const router = new VueRouter({
  routes
});

export default router;
